<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta charset="utf-8" />
    <title>后台管理 - 订单管理</title>

    <meta name="keywords" content="{$Think.CONFIG.keywords}" />
    <meta name="description" content="{$Think.CONFIG.description}" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
    <link rel="stylesheet" href="__PUBLIC__/css/page.css">
    <style>
        .header_top_position{position: fixed;top: 0;width: 150%;z-index: 999}
        #num{
            position: absolute;top: 1px;left: 70px;background: #9585bf;color: #fff;padding: 1px 6px;border-radius: 23px;
        }
    </style>
    <include file="Public/head" />
</head>
<?php $cates='active';$ptitle='分类管理';$title='列表';?>
<body class="no-skin">
<include file="Public/header" />
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try{ace.settings.check('main-container' , 'fixed')}catch(e){}
    </script>

    <include file="Public/sidebar" />
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs" />
            <div class="page-content">
                <include file="Public/set" />

                    <div class="row maintop">
                        <div style="margin:10px 0;" id="rule-add">
                            <form class="form-horizontal ajax-form" method="post" action="{:U('add_cate')}">
                                <div class="col-xs-12 col-sm-12">
                                    <small class="sl-left10">父级：</small>
                                    <small>
                                        <select name="parent_id" required>
                                            <option value="0">--默认顶级--</option>
                                            <foreach name="cate" item="v">
                                                <option value="{$v.id}" style="margin-left:55px;">{$v.good_cate_name}</option>
                                            </foreach>
                                        </select>
                                    </small>
                                    <small class="sl-left10">分类名称：</small>
                                    <small><input name="good_cate_name" class="rule"  placeholder=" 分类名称" required/></small>
                                    <button class="btn btn-xs btn-danger ruleadd">
                                        添加分类
                                    </button>
                                    </small>
                                </div>
                            </form>
                        </div>
                        <div class="row">
                            <div class="col-xs-8">
                                <div>
                                    <form class="ajax-form" name="cat" method="post" action="" >
                                        <table class="table table-striped table-bordered table-hover" id="dynamic-table">
                                            <thead>
                                            <tr>
                                                <th class="hidden-xs">ID</th>
                                                <th class="hidden-xs">分类名称</th>
                                                <th class="hidden-xs">分类图片</th>
                                                <th class="hidden-xs">操作</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <foreach name="cate" item="v">
                                                <tr>
                                                    <td height="28">{$v.id}</td>
                                                    <td class="hidden-xs" style='padding-left:<if condition="$v.parent_id neq 0">20px</if>' ><if condition="$v.good_parent_id neq 0">──┴</if>{$v.good_cate_name}</td>
                                                    <td class="hidden-xs">------</td>
                                                    <td>
                                                        <div class="hidden-sm hidden-xs action-buttons">
                                                            <if condition="$v.id eq 1">
                                                                ------
                                                                <else/>
                                                                <a class="btn btn-minier btn-danger ajax-delete" href="{:U('cateDel',array('cate_id'=>$v['id']))}" data-info="你确定要删除吗？">
                                                                    删除
                                                                </a>
                                                            </if>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <foreach name="v[data]" item="val">
                                                    <tr>
                                                        <td height="28">{$val.id}</td>
                                                        <td class="hidden-xs" style='padding-left:<if condition="$val.parent_id neq 0">20px</if>' ><if condition="$val.good_parent_id neq 0">──┴</if>{$val.good_cate_name}</td>
                                                        <td class="hidden-xs"><img src="__ROOT__{$val.cate_picture}" width="10%"></td>
                                                        <td>
                                                            <div class="hidden-sm hidden-xs action-buttons">
                                                                <a class="btn btn-minier btn-danger" href="{:U('cate_picture',array('cate_id'=>$val['id']))}">
                                                                    添加分类图标
                                                                </a>
                                                                <a class="btn btn-minier btn-danger ajax-delete" href="{:U('cateDel',array('cate_id'=>$val['id']))}" data-info="你确定要删除吗？">
                                                                    删除
                                                                </a>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </foreach>
                                            </foreach>
                                            </tbody>
                                        </table>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer" />

</div><!-- /.main-container -->

<include file="Public/footerjs" />
<!-- inline scripts related to this page -->
</body>
</html>
